# 王磊的作业
Friuts = {
    '苹果': 12.3,
    '草莓': 4.5,
    '香蕉': 6.3,
    '葡萄': 5.8,
    '橘子': 6.4,
    '樱桃': 15.8
}
msum = 0
gsum = 0
info = {
    '小明': {
        'fruits': {'苹果': 4, '草莓': 13, '香蕉': 10},
        'money': msum
    },
    '小刚': {
        'fruits': {'葡萄': 19, '橘子': 12, '樱桃': 30},
        'money': gsum
    }
}


def money(x):
    sum = 0
    for j in info[x]['fruits']:
        if j in Friuts:
            money = info[x]['fruits'][j] * Friuts[j]
            sum += money
    return sum


for i in info:
    if i == '小明':
        info[i].update({'money': money(i)})
    else:
        info[i].update({'money': money(i)})
print('小明消费', info['小明']['money'])
print('小刚消费', info['小刚']['money'])
